<?php $this->headScript()->appendFile($this->JS_PATH . 'form_deal.js'); ?>
<div id="deal-listing"></div>
<div class="clearfix"></div>
<div class="content">
    <div class="page-title"> <i class="icon-custom-right"></i>
        <h3><span class="semi-bold">Deal List</span></h3>
    </div>
    <div class="row">
        <div class="col-md-12">
            <form name="search_form" action="" method="post">
                <div class="col-md-12"> 
					<input type="text" style="width: 300px;" class="search" name="searchtype" value="<?php echo $this->searchtype; ?>" >&nbsp;&nbsp;
					<input class="btn btn-success" type="submit" name="" value="Search"/>&nbsp;&nbsp;
					<a class="btn btn-success" href="<?php echo $this->url(array('module'=>'admin','controller' => 'deals', 'action' => 'unsetsession', 'pagename' => 'list'), null, TRUE); ?>">Clear</a>
                </div>
            </form>
        </div>
    </div>
	
	<br/>
    <?php echo $this->flashmessages(); ?>
	<?php if (count($this->errorMessage) > 0): ?>
    <div class="alert alert-error">
        <?php foreach ($this->errorMessage as $erroValue): ?>
            <div class="text-left">
                <i class="icon-remove-sign"></i>
                <?php echo $erroValue; ?>
            </div>
        <?php endforeach; ?>
    </div>
	<?php endif; ?>
	<br/>
	
    <div class="row">
        <div class="col-md-12">
            <div class="grid simple transparent" style="background-color:white;">

                <div class="grid-body">
                    <div class="row">
                        <div class="col-md-12">
							<form action="" method="post" id="deallisting">
								<div class="grid simple ">

									<div class="grid-body no-border dataTables_wrapper form-inline">
										<h3>Deal <span class="semi-bold">Listing</span></h3>

										<table class="table table-hover">
											<thead>
												<tr>
													<td>
													<!--<input type="submit" accesskey="s" value="Delete all" name="multiaction"  id="multiaction" class="btn-flat danger"/>-->
													<button type="submit" name="multiaction" id="multiaction" value="delete" class="btn btn-danger" >Delete</button>
													</td>
													<td colspan="5" align="right">
														<a class="btn btn-success btn-cons"
														   href="<?php echo $this->url(array('module' => 'admin', 'controller' => 'deals', 'action' => 'form'), null, TRUE); ?>"
														   >+ Add Deal</a>
													</td>
												</tr>
												<tr>
													<th>   
														<input id="selectall" type="checkbox" name="multicheck"  />
													</th>
													<th class="col-md-4">
														<a href="<?php echo $this->url(array("controller" => "deals", "action" => "list", "field" => "deal_name", "sort" => "asc"), "default", false); ?>">
															<img src="<?php echo $this->IMAGE_PATH; ?>datatables/sort_asc.png"  alt="Ascending" title="Ascending" class="sort_asc" />
														</a>
														Deal Name
														<a href="<?php echo $this->url(array("controller" => "deals", "action" => "list", "field" => "deal_name", "sort" => "desc"), "default", false); ?>">
															<img src="<?php echo $this->IMAGE_PATH; ?>datatables/sort_desc.png"  alt="Descending" title="Descending" class="sort_desc"  />
														</a>
													</th>
													<th class="col-md-4">
														<a href="<?php echo $this->url(array("controller" => "client", "action" => "list", "field" => "clnt_type", "sort" => "asc"), "default", false); ?>">
															<img src="<?php echo $this->IMAGE_PATH; ?>datatables/sort_asc.png"  alt="Ascending" title="Ascending" class="sort_asc" />
														</a>
														Responsible
														<a href="<?php echo $this->url(array("controller" => "client", "action" => "list", "field" => "clnt_type", "sort" => "desc"), "default", false); ?>">
															<img src="<?php echo $this->IMAGE_PATH; ?>datatables/sort_desc.png"  alt="Descending" title="Descending" class="sort_desc"  />
														</a>
													</th>
													
													<th class="col-md-2">
														<span class="cls_action"> Action</span>
													</th>
												</tr>
											</thead>
											<tbody>
												<?php if (count($this->dealData) > 0): ?>
													<?php $counter = 0; ?>
													<?php foreach ($this->dealData as $key => $value) : ?>
														<!-- row -->
													<tr <?php if ($counter == 0): ?>class="first"<?php endif; ?>>
														 <!--<td> 
														<a href="<?php echo $this->url(array("module" => "admin", "controller" => "deals", "action" => "form", "deal_id" => $value["deal_id"]), null, true); ?>">
															<?php echo $value["city_title"]; ?>
														</a>
														</td>-->
														<td>
															<input type="checkbox" class="content-checkbox chek_all" name="multicheck[]" value="<?php echo $value["deal_id"]; ?>"/>
														</td>
														<td> 
															<?php echo $value['deal_name']; ?>
														</td>
														<td> 
															<?php echo $value["lgn_email"]; ?>
														</td>
														
														<td>
															<a class="label label-success clickable" href="<?php echo $this->url(array('module' => 'admin', 'controller' => 'deals', 'action' => 'form', 'deal_id' => $value["deal_id"]), null, true); ?>">
																Edit
															</a>&nbsp;
															
															<a href="#" class="deletemodal label label-important clickable" target_href="<?php echo $this->url(array('module' => 'admin', 'controller' => 'deals', 'action' => 'delete', 'deal_id' => $value["deal_id"]), null, true); ?>">
																Delete
															</a>
														</td>
													</tr>
														<?php $counter++; ?>
													<?php endforeach; ?>
												<?php else: ?>
													<tr class="row2" >
														<td>&nbsp;</td>
														<td colspan="8"> No Record Found</td>
													</tr>
												<?php endif; ?>
											</tbody>
										</table>
										<div class="row">
											<div class="col-md-12">
												<div class="dataTables_paginate paging_bootstrap pagination">
													<?php echo $this->paginator->displayPages(); ?>
												</div>
											</div>
										</div>
									</div>
								</div>
							</form>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<!-- END PAGE -->